package com.ikun.kunaicode.service;

import com.ikun.kunaicode.model.dto.app.AppQueryRequest;
import com.ikun.kunaicode.model.entity.User;
import com.ikun.kunaicode.model.vo.AppVO;
import com.mybatisflex.core.query.QueryWrapper;
import com.mybatisflex.core.service.IService;
import com.ikun.kunaicode.model.entity.App;
import reactor.core.publisher.Flux;

import java.util.List;

/**
 * 应用表 服务层。
 *
 * @author cxk
 */
public interface AppService extends IService<App> {


    /**
     * 代码生成
     * @param appId 应用id
     * @param message 提示词
     * @param loginUser 登录用户
     * @return 响应流
     */
    Flux<String> chatToGenCode(Long appId, String message, User loginUser);

    /**
     * 部署应用
     * @param appId 应用id
     * @param loginUser 登录用户
     * @return 部署域名
     */
    String deployApp(Long appId, User loginUser);

    AppVO getAppVO(App app);

    /**
     * 构造查询条件
     * @param appQueryRequest 应用查询请求
     * @return
     */
    QueryWrapper getQueryWrapper(AppQueryRequest appQueryRequest);

    /**
     * 获取应用列表
     * @param appList
     * @return
     */
    List<AppVO> getAppVOList(List<App> appList);
}
